Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrade various logs to DEBUG level #2557

Merged
merged 3 commits into from
Jan 29, 2024
Merged

Conversation

tgeoghegan
Copy link
Contributor

The Trillium handler for errors was unconditionally logging them at WARN, generating large volumes of logging for problems that aren't Janus' fault, like reports whose timestamps are in the future. Now, we check whether the respones indicates a server error before bothing to log it (keeping in mind that client errors will still appear in metrics).

Additionally, we've made liberal use of the tracing::instrument attribute macro to decorate various functions and methods with tracing spans, and in particular its err argument for logging anytime a function that returns Result<T, E> returns an Err. Mostly, logging those errors is handled at a higher level -- say, in a Trillium handler or in the top-level loop of aggregation_job_driver -- so logging them at level ERROR at the function call itself isn't that helpful. This commit further qualifies the err argument so that those errors are now logged at DEBUG, so we can opt back into them should they prove useful.

The Trillium handler for errors was unconditionally logging them at
`WARN`, generating large volumes of logging for problems that aren't
Janus' fault, like reports whose timestamps are in the future. Now, we
check whether the respones indicates a server error before bothing to
log it (keeping in mind that client errors will still appear in
metrics).

Additionally, we've made liberal use of the [`tracing::instrument`][1]
attribute macro to decorate various functions and methods with tracing
spans, and in particular its `err` argument for logging anytime a
function that returns `Result<T, E>` returns an `Err`. Mostly, logging
those errors is handled at a higher level -- say, in a Trillium handler
or in the top-level loop of `aggregation_job_driver` -- so logging them
at level `ERROR` at the function call itself isn't that helpful. This
commit further qualifies the `err` argument so that those errors are now
logged at `DEBUG`, so we can opt back into them should they prove
useful.

[1]: https://docs.rs/tracing/latest/tracing/attr.instrument.html
@tgeoghegan tgeoghegan requested a review from a team as a code owner January 27, 2024 19:44
@tgeoghegan
Copy link
Contributor Author

This will need backport to release/0.6 should we go ahead with it.

@tgeoghegan tgeoghegan marked this pull request as draft January 27, 2024 19:49
@tgeoghegan tgeoghegan marked this pull request as ready for review January 27, 2024 21:55
@inahga
Copy link
Contributor

inahga commented Jan 29, 2024

I think this will partially, if not wholly, address #2462.

Copy link
Contributor

@inahga inahga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unfortunate to lose datastore logging because I think it does reveal some interesting information for troubleshooting, but I think it means we should be more aggressive about turning up the log level at runtime when we need to debug.

@tgeoghegan tgeoghegan merged commit b8403b4 into main Jan 29, 2024
8 checks passed
@tgeoghegan tgeoghegan deleted the timg/downgrade-more-logs branch January 29, 2024 18:33
tgeoghegan added a commit that referenced this pull request Jan 29, 2024
The Trillium handler for errors was unconditionally logging them at
`WARN`, generating large volumes of logging for problems that aren't
Janus' fault, like reports whose timestamps are in the future. Now, we
check whether the respones indicates a server error before bothing to
log it (keeping in mind that client errors will still appear in
metrics).

Additionally, we've made liberal use of the [`tracing::instrument`][1]
attribute macro to decorate various functions and methods with tracing
spans, and in particular its `err` argument for logging anytime a
function that returns `Result<T, E>` returns an `Err`. Mostly, logging
those errors is handled at a higher level -- say, in a Trillium handler
or in the top-level loop of `aggregation_job_driver` -- so logging them
at level `ERROR` at the function call itself isn't that helpful. This
commit further qualifies the `err` argument so that those errors are now
logged at `DEBUG`, so we can opt back into them should they prove
useful.

[1]: https://docs.rs/tracing/latest/tracing/attr.instrument.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants